/* 采购管理 */
import request from '@/utils/request'
import { rsaEncrypt } from '@/utils/commonUtil3'
// 采购订单管理

// 获取可以添加的商品列表
export const reqGoodsList = data => request({ url: '/commodity/getBySupplier', method: 'GET', params: { ...data } })
// 获取供应商列表
export const reqSupplierList = () => request({ url: '/supplier/selectList', method: 'GET' })
// 获取仓库列表
export const reqWarehouseList = () => request({ url: '/warehouse/selectInfo', method: 'GET' })
// 添加采购订单
export const reqAddProcureOrder = data => request({ url: '/buyOrder/insert', method: 'POST', data: { data: rsaEncrypt(data) } })
// 分页查询采购订单
export const reqBuyOrderList = data => request({ url: '/buyOrder/select', method: 'GET', params: { ...data } })
// 获取采购员列表
export const reqBuyerList = data => request({ url: '/sysUser/selectUserByInternalRole', method: 'GET', params: { ...data } })
// 获取采购订单详情
export const reqOrderDetailsById = data => request({ url: '/buyOrder/selectDetails', method: 'GET', params: { ...data } })
// 订单作废
export const reqCancelOrder = data => request({ url: '/buyOrder/nullify', method: 'PUT', data: { data: rsaEncrypt(data) } })
// 修改采购订单
export const reqUpdateBuyOrder = data => request({ url: '/buyOrder/update', method: 'PUT', data: { data: rsaEncrypt(data) } })
// 暂存采购单
export const reqTempSaveOrder = data => request({ url: '/buyOrder/temp/save', method: "POST", data: { data: rsaEncrypt(data) } });
// 获取暂存记录
export const reqTempSaveList = data => request({ url: '/buyOrder/temp/select', method: "GET", params: { ...data } });
// 获取暂存详情
export const reqTempSaveDetail = data => request({ url: '/buyOrder/temp/details', method: 'GET', params: { ...data } });
// 删除暂存单
export const reqDelTempSaveOrder = data => request({ url: '/buyOrder/temp/delete', method: 'DELETE', data: { data: rsaEncrypt(data) } });

// 点采退货管理接口

// 获取点采退货分页列表
export const reqExamineList = data => request({ url: '/storeReturnsOrder/selectStoreReturnsOrders', method: 'GET', params: { ...data } })
// 退货审核通过
export const reqToExamine = data => request({ url: '/storeReturnsOrder/updateStoreReturnsOrder', method: 'PUT', data: { data: rsaEncrypt(data) } });
// 查看退货订单详情
export const reqExamineById = data => request({ url: '/storeReturnsOrder/selectStoreReturnsList', method: 'GET', params: { ...data } })